package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiSrtpConstraintMapper;
import com.ruoyi.net.domain.BusiSrtpConstraint;
import com.ruoyi.net.service.IBusiSrtpConstraintService;

/**
 * 业务-srtp-路由约束配置Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class BusiSrtpConstraintServiceImpl implements IBusiSrtpConstraintService 
{
    @Autowired
    private BusiSrtpConstraintMapper busiSrtpConstraintMapper;

    /**
     * 查询业务-srtp-路由约束配置
     * 
     * @param id 业务-srtp-路由约束配置主键
     * @return 业务-srtp-路由约束配置
     */
    @Override
    public BusiSrtpConstraint selectBusiSrtpConstraintById(String id)
    {
        return busiSrtpConstraintMapper.selectBusiSrtpConstraintById(id);
    }

    /**
     * 查询业务-srtp-路由约束配置列表
     * 
     * @param busiSrtpConstraint 业务-srtp-路由约束配置
     * @return 业务-srtp-路由约束配置
     */
    @Override
    public List<BusiSrtpConstraint> selectBusiSrtpConstraintList(BusiSrtpConstraint busiSrtpConstraint)
    {
        return busiSrtpConstraintMapper.selectBusiSrtpConstraintList(busiSrtpConstraint);
    }

    /**
     * 新增业务-srtp-路由约束配置
     * 
     * @param busiSrtpConstraint 业务-srtp-路由约束配置
     * @return 结果
     */
    @Override
    public int insertBusiSrtpConstraint(BusiSrtpConstraint busiSrtpConstraint)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiSrtpConstraint.getId())) {
            busiSrtpConstraint.setId(uuid);
        }
        busiSrtpConstraint.setCreateBy(SecurityUtils.getUsername());
        busiSrtpConstraint.setCreateTime(DateUtils.getNowDate());
        busiSrtpConstraint.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpConstraint.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpConstraintMapper.insertBusiSrtpConstraint(busiSrtpConstraint);
    }

    /**
     * 修改业务-srtp-路由约束配置
     * 
     * @param busiSrtpConstraint 业务-srtp-路由约束配置
     * @return 结果
     */
    @Override
    public int updateBusiSrtpConstraint(BusiSrtpConstraint busiSrtpConstraint)
    {
        busiSrtpConstraint.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpConstraint.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpConstraintMapper.updateBusiSrtpConstraint(busiSrtpConstraint);
    }

    /**
     * 批量删除业务-srtp-路由约束配置
     * 
     * @param ids 需要删除的业务-srtp-路由约束配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpConstraintByIds(String[] ids)
    {
        return busiSrtpConstraintMapper.deleteBusiSrtpConstraintByIds(ids);
    }

    /**
     * 删除业务-srtp-路由约束配置信息
     * 
     * @param id 业务-srtp-路由约束配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpConstraintById(String id)
    {
        return busiSrtpConstraintMapper.deleteBusiSrtpConstraintById(id);
    }
}
